#ifndef REPOSITORIESLISTPRESENTER_H_
#define REPOSITORIESLISTPRESENTER_H_

#include <exception>
#include <vector>
#include "presenters/AbstractPresenter.h"

class IRepositoriesListView;
class ServiceLocator;
class IRepositoryService;
class RepositoryDto;

class RepositoriesListPresenter : public AbstractPresenter<IRepositoriesListView>
{
public:
	explicit RepositoriesListPresenter(IRepositoriesListView *view);
	virtual ~RepositoriesListPresenter();

	void setServiceLocator(ServiceLocator *serviceLocator);
	void loadRepositoriesList();

private:
	ServiceLocator *m_serviceLocator;
	IRepositoryService *getRepositoryService() const;
	void RepositoriesListLoaded(std::vector<RepositoryDto> *repositoriesList);
	void RepositoriesListLoadError(std::exception exception);
};

#endif /* REPOSITORIESLISTPRESENTER_H_ */
